package com.dongdongshop.service.imp;

import com.dongdongshop.mapper.TbContentMapper;
import com.dongdongshop.pojo.TbContent;
import com.dongdongshop.service.ContentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class ContentServiceImp implements ContentService {
    @Resource
    private TbContentMapper tbContentMapper;
    @Override
    public List<TbContent> getContent() {
        return tbContentMapper.selectContent();
    }

    @Override
    public int andInfo(TbContent tbContent) {
        return tbContentMapper.insertSelective(tbContent);
    }

    @Override
    public TbContent toUpdate(Long id) {
        return tbContentMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updatInfoConten(TbContent tbContent) {
        return tbContentMapper.updateByPrimaryKey(tbContent);
    }

    @Override
    public int deleteInfoContent(Long[] ids) {
        return tbContentMapper.deleteInfoContent(ids);
    }

    @Override
    public List<TbContent> selectShuff(Long categoryId) {
        return tbContentMapper.selectShuff(categoryId);
    }

    @Override
    public List<TbContent> getDayList(Long categoryId) {

        return tbContentMapper.getDayList(categoryId);
    }

    @Override
    public List<TbContent> getLikeList(Long categoryId) {
        return tbContentMapper.getLikeList(categoryId);
    }
}
